package org.NooLab.glue.filter;

import org.NooLab.glue.MessageBoard;
import org.NooLab.glue.msgframe.XMessage;
import org.NooLab.utilities.logging.PrintLog;
 
public class IboardsReplyHandler extends MessageInterpreter{

	
	
	public IboardsReplyHandler( MessageBoard messageboard, 
			 				    PrintLog outprn){
		super( messageboard, null, outprn );
		
		
	}
	
	
	
	public void interpretingMessage( String rawXmlMsg ){
		String[] rawIndicators ;
		XMessage xmsg ;
		int p1;
		xmsg = new XMessage(out) ;
		
		
		if (rawXmlMsg.length() > 40){
		
			originatorID = xmsg.getInfoFromProlog( rawXmlMsg, "origin", "id", ".");
			rawXmlMsg = xmsg.removePrologFromXml(rawXmlMsg) ;
			
			if (originatorID.length()==0){
				originatorID = xmsg.getSpecifiedInfo(rawXmlMsg, "//originator", "id") ;
			}
			
			
			p1 = rawXmlMsg.indexOf("<connect>");
			
			if (p1>0){
				out.printErr(2, "\nIboardsReplyHandler...\n");
				/*
				   <connect>
				      <instance name="mb1-board-67cad94c-146b-4b63-b67c-19e3acdbaa60"/>
				      <origin value="mb1-embeddedsrc-iboard-1-bedcd4b1-80a7-4c70-8dc3-a3fe3816b56f"/>
				      <environment capacity="0"/>
				   </connect>
				 */  
				rawIndicators = new String[]{"<request ","type=\"transaction\""} ;
				
				
			}
			
			
			
			
		} // message long enough
		
	} // interpretingMessage()
	
	
	/*
	
	private boolean sourceVariant_DelayedDataRelayToReceptor( XMessage xmsg, String rawXmlMsg, String[] rawIndicators ){
		boolean result=false, hb ;
		long td,expiryTime, deliveryTime,instanceID, transactionID ;
		
		
		
		result = xmsg.rawIndicatorsCheck( rawXmlMsg, rawIndicators);
		
		if ( result ){
			result = true; 	
	
	*/
	
}
